<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<!-- ::link, ::style, ::script-->
<head th:replace="fragment :: common_head(~{::meta},~{::title},~{},~{},~{::script})">
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>1. Array</title>
    <script>
        window.onload = function() {
            // Array.from() 将类数组变为数组
            let ps = document.querySelectorAll('p');
            Array.from(ps).forEach(function(p) {
                console.log(p);
            });

            // Array.of() 弥补构造函数的不足
            console.log(Array.of(3, 4, 5));
            console.log(Array.of(3));
        };
    </script>
</head>
<body>
<header id="header" th:replace="fragment :: header"></header>
<p id="id1">aa</p>
<p id="id2">bb</p>
<footer id="footer" th:replace="fragment :: footer"></footer>
</body>
</html>
